package net.bplaced.streetfighter.lib.model;

import com.google.gson.annotations.SerializedName;

/**
 * @author Sebastian Hoffmann <bo.hoffi@googlemail.com>
 */
public class Team {

    public Integer id;

    public Integer rank;

    @SerializedName("teamName")
    public String name;

    @SerializedName("rankStatus")
    public String status;

    public Integer matchesWon;

    public Integer matchesDraw;

    public Integer matchesLost;

    public Integer goalsShot;

    public Integer goalsGet;

    public Team() {

    }

    public Integer getGoalDiff() {

        return (this.goalsShot - this.goalsGet);
    }

    public String getGoalPercentage() {

        return new StringBuilder().append(this.goalsShot).append(":").append(this.goalsGet).toString();
    }

    public Integer getMatchesPlayed() {

        return (this.matchesWon + this.matchesDraw + this.matchesLost);
    }

    public Integer getPoints() {

        return ((this.matchesWon * 3) + (this.matchesDraw * 1));
    }

    @Override
    public String toString() {

        return this.name;
    }
}